Skip to main content
POST
/
cortex
/
analytics
/
search
Log Search Analytics
curl --request POST \
  --url https://api.sophra.org/api/cortex/analytics/search \
  --header 'Content-Type: application/json' \
  --data '{
  "query": "machine learning optimization",
  "searchType": "hybrid",
  "totalHits": 150,
  "took": 234,
  "sessionId": "sess_abc123",
  "facets": {
    "authors": [
      "John Smith",
      "Jane Doe"
    ],
    "tags": [
      "AI",
      "ML"
    ],
    "yearPublished": {
      "min": 2020,
      "max": 2024
    },
    "source": [
      "arXiv",
      "IEEE"
    ],
    "selectedFilters": {
      "contentType": "research-paper",
      "language": "en",
      "hasCode": true
    }
  }
}'

Body

application/json
query
string
required

The search query

searchType
enum<string>
required

Type of search performed

Available options:
text,
vector,
hybrid
sessionId
string
required

Session identifier

totalHits
integer

Total number of search results

took
integer

Time taken to perform the search in milliseconds

facets
object

Response

201

Search analytics logged successfully

I